/* Common Styles */
.text-analysis-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.analysis-form {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Auth Forms */
.auth-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0 1rem;
}

.auth-form {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2c3e50;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.auth-form .submit-button {
  width: 100%;
  padding: 0.75rem;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.auth-form .submit-button:hover {
  background-color: #2980b9;
}

.auth-form .submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-links {
  text-align: center;
  margin-top: 1rem;
}

.auth-links a {
  color: #3498db;
  text-decoration: none;
  font-size: 0.9rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

.error {
  color: #dc3545;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

.feature-selection {
  margin: 1.5rem 0;
}

.feature-selection h3 {
  margin-bottom: 1rem;
}

.feature-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.feature-button {
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.feature-button:hover:not(:disabled) {
  background-color: #e9ecef;
  border-color: #ced4da;
}

.feature-button.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

.feature-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.submit-button {
  width: 100%;
  padding: 1rem;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
  margin-top: 1rem;
}

.submit-button:hover:not(:disabled) {
  background-color: #2980b9;
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loading-indicator {
  text-align: center;
  margin: 2rem 0;
  color: #6c757d;
}

/* Image Processing Specific Styles */
.preview-container {
  margin: 1.5rem 0;
  text-align: center;
}

.image-preview {
  max-width: 100%;
  max-height: 400px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Navigation Styles */
.main-nav {
  background-color: #2c3e50;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand a {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: #ecf0f1;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.nav-links a:hover {
  background-color: #34495e;
}

.nav-links a.active {
  background-color: #3498db;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid #34495e;
}

.username {
  color: #ecf0f1;
  font-size: 0.9rem;
}

.logout-button {
  background-color: transparent;
  border: 1px solid #ecf0f1;
  color: #ecf0f1;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.logout-button:hover {
  background-color: #ecf0f1;
  color: #2c3e50;
}

/* Image Processing Styles */
.image-preview {
  max-width: 100%;
  max-height: 300px;
  margin: 1rem 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-container {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.file-input {
  width: 100%;
  padding: 0.5rem;
  margin: 0.5rem 0;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.history-section {
  margin-top: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.history-item {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.result-item {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.result-item h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.result-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.result-item ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-item li {
  padding: 0.25rem 0;
  color: #666;
}

/* Loading indicator for image processing */
.loading-indicator {
  text-align: center;
  padding: 1rem;
  margin: 1rem 0;
  background: #f8f9fa;
  border-radius: 8px;
  color: #666;
}

/* Feature buttons for image processing */
.feature-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.feature-button {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.feature-button:hover:not(:disabled) {
  background: #f0f0f0;
}

.feature-button.active {
  background: #007bff;
  color: white;
  border-color: #0056b3;
}

.feature-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detection-list {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #f8f9fa;
  border-radius: 4px;
  overflow: hidden;
}

.detection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #dee2e6;
}

.detection-item:last-child {
  border-bottom: none;
}

.detection-class {
  font-weight: 500;
  color: #2c3e50;
}

.detection-confidence {
  background: #e9ecef;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #495057;
}

.segmentation-results {
  margin-top: 1rem;
}

.segmentation-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.segmentation-image,
.segmentation-mask {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
}

.segmentation-image h5,
.segmentation-mask h5 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
}

.segmentation-stats {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.segmentation-stats p {
  margin: 0;
  color: #2c3e50;
  font-weight: 500;
}

.top-segments {
  margin-top: 1rem;
}

.top-segments h5 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
}

.segments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.segment-item {
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.segment-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.segment-info {
  padding: 0.75rem;
}

.segment-info p {
  margin: 0.25rem 0;
  color: #2c3e50;
  font-size: 0.9rem;
}

.segment-info p:first-child {
  font-weight: 500;
  color: #2c3e50;
}

/* Basic Image Processing Styles */
.basic-settings {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setting-item label {
  font-weight: 500;
  color: #2c3e50;
}

.setting-item input[type="range"] {
  width: 100%;
  height: 6px;
  background: #dee2e6;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #3498db;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.setting-item input[type="range"]::-webkit-slider-thumb:hover {
  background: #2980b9;
}

.setting-item span {
  font-size: 0.9rem;
  color: #6c757d;
  text-align: center;
}

.setting-item select {
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
  color: #2c3e50;
  cursor: pointer;
  transition: border-color 0.3s;
}

.setting-item select:focus {
  outline: none;
  border-color: #3498db;
}

.setting-item select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Image Generation Styles */
.prompt-input {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s;
}

.prompt-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.generation-settings {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.generation-info {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}

.generation-info p {
  margin: 0.5rem 0;
  color: #2c3e50;
  font-size: 0.9rem;
}

.generation-info strong {
  color: #2c3e50;
  margin-right: 0.5rem;
}

/* View Toggle Styles */
.view-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.view-button {
  padding: 0.5rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.view-button:hover:not(:disabled) {
  background: #f0f0f0;
}

.view-button.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

/* JSON View Styles */
.json-view {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* History List Styles */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-item {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.history-text {
  margin: 0;
  color: #2c3e50;
  font-weight: 500;
}

.history-time {
  margin: 0.5rem 0 0;
  color: #6c757d;
  font-size: 0.9rem;
} 